--[[ 编码: hh-mobox-006 名称: 总数 作者:SGX 日期:2024-11-17 函数: GenerateViewHTML 功能: 更改记录: --]] json = require("json") mobox = require("OILua_JavelinExt") m3 = require( "oi_base_mobox" ) function GenerateViewHTML(strLuaDEID) local nRet, strRetInfo --[[ 方块1 ]] local count local strCondtion = "EXTRACT(YEAR FROM T_CREATE) = EXTRACT(YEAR FROM SYSDATE) AND S_OP_NAME IN('粉料入库','退料入库','国自空托回库','立库入库','保温材料入库')" nRet, count = mobox.getDataObjCount(strLuaDEID, "Task", strCondtion) if (nRet ~= 0) then lua.Error(strLuaDEID, debug.getinfo(1), "获取任务失败!"..count) end local strFKTitle1 = "年度入库总量"; local strFKData1 = count; local strFKBack1 = "#8BC34A"; --[[ 方块2 ]] strCondtion = "EXTRACT(YEAR FROM T_CREATE) = EXTRACT(YEAR FROM SYSDATE) AND S_OP_NAME IN('粉料出库','呼叫空托','采购退货','立库出库')" nRet, count = mobox.getDataObjCount(strLuaDEID, "Task", strCondtion) if (nRet ~= 0) then lua.Error(strLuaDEID, debug.getinfo(1), "获取任务失败!"..count) end local strFKTitle2 = "年度出库总量"; local strFKData2 = count; local strFKBack2 = "#FF9800"; -- local strHtml = '
' .. -- '
' .. -- '
' .. strFKTitle1 .. '
' .. -- '
' .. -- strFKData1 .. '
' .. '
' .. '
' .. -- '
' .. strFKTitle2 .. '
' .. -- '
' .. -- strFKData2 .. '
' .. '
' .. '
' local strHtml = '
' .. '
' .. '
' .. strFKTitle1 .. '
' .. '
' .. strFKData1 .. '
' .. '
' .. '
' .. '
' .. strFKTitle2 .. '
' .. '
' .. strFKData2 .. '
' .. '
' .. '
' local action = {} action[1] = { action_type = "chart", value = { graphicType = "html", title = { text = "总数", align = "center", color = "#000", font = "微软雅黑", fontSize = 16 }, html = strHtml } } -- lua.Debug( strLuaDEID, debug.getinfo(1), "action! ", action ) nRet, strRetInfo = mobox.setAction(strLuaDEID, lua.table2str(action)) if (nRet ~= 0) then lua.Error(strLuaDEID, debug.getinfo(1), "setAction失败! " .. strRetInfo .. ' action = ' .. strAction) end end